const NewsService = require("../../services/web/NewsService")





const NewsController = {
    getList: async (req, res) => {
        try {
            const result = await NewsService.getList({ _id: req.params.id })
            // console.log(result);
            res.send({
                ActionType: "OK",
                data: result
            })
        } catch (error) {
            res.send({ errorMsg: "查询新闻失败" });
        }
    },
    getTopList:async (req,res) => {
        try {
            const result = await NewsService.getTopList({ limit: req.query.limit })
            // console.log(result);
            res.send({
                ActionType: "OK",
                data: result
            })
        } catch (error) {
            res.send({ errorMsg: "查询新闻失败" });
        }
    }

}


module.exports = NewsController

